home *** CD-ROM | disk | FTP | other *** search
/ PC User 2001 August / APC_Aug2001_CD2.iso / features / web_dev / files / mwjpp516.exe / %MAINDIR% / Tools / Html / insert Center.script < prev    next >
Encoding:
Text File  |  2001-06-19  |  875 b   |  34 lines

  1. !!Script
  2. // Copyright ⌐ 1997-1998 - Modelworks Software
  3.  
  4. /**
  5. @Tool: insert Center~wraps the current selection with 
  6. <CENTER> ... </CENTER> tags. 
  7. @EndTool: 
  8. @Summary: insert Center~wraps selection with the Center tag
  9. */
  10.  
  11.  
  12. function DoCommand()
  13. {
  14.     var editor = getActiveEditor();
  15.     if (editor)
  16.     {
  17.         var selection = editor.getSelection();
  18.         var upperCaseHtmlTags = getMapFileValue("Preferences", "Upper Case HTML Tags", true);
  19.         if(upperCaseHtmlTags)
  20.         {
  21.             editor.insert(selection.endLineIndex, selection.endCharIndex, "</CENTER>");
  22.             editor.insert(selection.startLineIndex, selection.startCharIndex, "<CENTER>");
  23.         }
  24.         else
  25.         {
  26.             editor.insert(selection.endLineIndex, selection.endCharIndex, "</center>");
  27.             editor.insert(selection.startLineIndex, selection.startCharIndex, "<center>");
  28.         }
  29.         editor.setActive();
  30.     }
  31. }
  32.  
  33. !!/Script
  34.